﻿Public Class f_mascotas

    Dim c As New Controlador
    Public alta_mascota As Boolean = False

    Private Sub f_macotas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        c.muestra_mascotas()
        dg_mascotas.Columns(0).HeaderText = "Nombre"
        dg_mascotas.Columns(1).HeaderText = "Dueño"
        dg_mascotas.Columns(2).HeaderText = "Adopción"

    End Sub

    Private Sub tb_b_nombre_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_b_nombre.TextChanged
        c.buscar_mascotas()
    End Sub

    Private Sub tb_b_dueno_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_b_dueno.TextChanged
        c.buscar_mascotas()
    End Sub

    Private Sub c_b_b_adopcion_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb_b_adopcion.SelectedIndexChanged
        c.buscar_mascotas()
    End Sub

    Private Sub b_guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        c.guardar_f_mascotas()
    End Sub

    Private Sub dg_mascotas_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg_mascotas.CellContentClick
        Me.alta_mascota = False
        Dim id = Me.cb_dueno.SelectedValue

    End Sub


End Class